package com.zhang;

public class Main {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        System.out.println("top:" + stack.top());
        System.out.println("size:" + stack.size());
        while (!stack.isEmpty()) {
            System.out.println("pop:" + stack.pop());
            System.out.println("size:" + stack.size());
        }
    }
}
